package com.ruoyi.sales.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sales.mapper.SalesCustomerMapper;
import com.ruoyi.sales.domain.SalesCustomer;
import com.ruoyi.sales.service.ISalesCustomerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class SalesCustomerServiceImpl implements ISalesCustomerService 
{
    @Autowired
    private SalesCustomerMapper salesCustomerMapper;

    /**
     * 查询客户信息
     * 
     * @param customerId 客户信息主键
     * @return 客户信息
     */
    @Override
    public SalesCustomer selectSalesCustomerByCustomerId(Long customerId)
    {
        return salesCustomerMapper.selectSalesCustomerByCustomerId(customerId);
    }

    /**
     * 查询客户信息列表
     * 
     * @param salesCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public List<SalesCustomer> selectSalesCustomerList(SalesCustomer salesCustomer)
    {
        return salesCustomerMapper.selectSalesCustomerList(salesCustomer);
    }

    /**
     * 新增客户信息
     * 
     * @param salesCustomer 客户信息
     * @return 结果
     */
    @Override
    public int insertSalesCustomer(SalesCustomer salesCustomer)
    {
        return salesCustomerMapper.insertSalesCustomer(salesCustomer);
    }

    /**
     * 修改客户信息
     * 
     * @param salesCustomer 客户信息
     * @return 结果
     */
    @Override
    public int updateSalesCustomer(SalesCustomer salesCustomer)
    {
        return salesCustomerMapper.updateSalesCustomer(salesCustomer);
    }

    /**
     * 批量删除客户信息
     * 
     * @param customerIds 需要删除的客户信息主键
     * @return 结果
     */
    @Override
    public int deleteSalesCustomerByCustomerIds(String customerIds)
    {
        return salesCustomerMapper.deleteSalesCustomerByCustomerIds(Convert.toStrArray(customerIds));
    }

    /**
     * 删除客户信息信息
     * 
     * @param customerId 客户信息主键
     * @return 结果
     */
    @Override
    public int deleteSalesCustomerByCustomerId(Long customerId)
    {
        return salesCustomerMapper.deleteSalesCustomerByCustomerId(customerId);
    }
}
